using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;
using System.ComponentModel;



	public partial class ConvertExtension
	{
		public static ClassLibrary2.Class1 Convert(ClassLibrary1.Class1 src0)
		{
			dynamic dest0;
			dynamic src1, dest1, src2, dest2, src3, dest3, src4, dest4, src5, dest5, src6, dest6, src7, dest7, src8, dest8, src9, dest9;
			dest0 = new ClassLibrary2.Class1();
			dest0.Name = src0.Name;
			src1 = src0.compositeType1;
			dest1 = new ClassLibrary2.CompositeType1();
			dest1.composite2Collection = new System.Collections.Generic.List<ClassLibrary2.CompositeType2>();
			for (int i1 = 0; i1 < src1.composite2Collection.Count; i1++)
			{
				src2 = src1.composite2Collection[i1];
				dest2 = new ClassLibrary2.CompositeType2();
				dest2.composite3Collection = new System.Collections.Generic.List<ClassLibrary2.CompositeType3>();
				for (int i2 = 0; i2 < src2.composite3Collection.Count; i2++)
				{
					src3 = src2.composite3Collection[i2];
					dest3 = new ClassLibrary2.CompositeType3();
					dest3.unsignedID = src3.unsignedID;
					dest3.composite4List = new System.Collections.Generic.List<ClassLibrary2.CompositeType4>();
					for (int i3 = 0; i3 < src3.composite4List.Count; i3++)
					{
						src4 = src3.composite4List[i3];
						dest4 = new ClassLibrary2.CompositeType4();
						dest4.identifier = src4.identifier;
						dest4.Width = src4.Width;
						src5 = src4.compositeType5;
						dest5 = new ClassLibrary2.CompositeType5();
						dest5.signedByte = src5.signedByte;
						dest5.isEnabled = src5.isEnabled;
						dest4.compositeType5 = dest5;
						dest3.composite4List.Add(dest4);
					}
					src4 = src3.compositeType5;
					dest4 = new ClassLibrary2.CompositeType5();
					dest4.signedByte = src4.signedByte;
					dest4.isEnabled = src4.isEnabled;
					dest3.compositeType5 = dest4;
					src4 = src3.struct1;
					dest4 = new ClassLibrary2.Struct1();
					dest4.category = src4.category;
					dest4.id = src4.id;
					dest3.struct1 = dest4;
					dest3.LastUpdated = src3.LastUpdated;
					dest2.composite3Collection.Add(dest3);
				}
				src3 = src2.compositeType3;
				dest3 = new ClassLibrary2.CompositeType3();
				dest3.unsignedID = src3.unsignedID;
				dest3.composite4List = new System.Collections.Generic.List<ClassLibrary2.CompositeType4>();
				for (int i3 = 0; i3 < src3.composite4List.Count; i3++)
				{
					src4 = src3.composite4List[i3];
					dest4 = new ClassLibrary2.CompositeType4();
					dest4.identifier = src4.identifier;
					dest4.Width = src4.Width;
					src5 = src4.compositeType5;
					dest5 = new ClassLibrary2.CompositeType5();
					dest5.signedByte = src5.signedByte;
					dest5.isEnabled = src5.isEnabled;
					dest4.compositeType5 = dest5;
					dest3.composite4List.Add(dest4);
				}
				src4 = src3.compositeType5;
				dest4 = new ClassLibrary2.CompositeType5();
				dest4.signedByte = src4.signedByte;
				dest4.isEnabled = src4.isEnabled;
				dest3.compositeType5 = dest4;
				src4 = src3.struct1;
				dest4 = new ClassLibrary2.Struct1();
				dest4.category = src4.category;
				dest4.id = src4.id;
				dest3.struct1 = dest4;
				dest3.LastUpdated = src3.LastUpdated;
				dest2.compositeType3 = dest3;
				dest2.URI = src2.URI;
				dest2.Total = src2.Total;
				dest1.composite2Collection.Add(dest2);
			}
			dest1.description = src1.description;
			dest0.compositeType1 = dest1;


			src1 = src0.compositeType2;
			dest1 = new ClassLibrary2.CompositeType2();
			dest1.composite3Collection = new System.Collections.Generic.List<ClassLibrary2.CompositeType3>();
			for (int i1 = 0; i1 < src1.composite3Collection.Count; i1++)
			{
				src2 = src1.composite3Collection[i1];
				dest2 = new ClassLibrary2.CompositeType3();
				dest2.unsignedID = src2.unsignedID;
				dest2.composite4List = new System.Collections.Generic.List<ClassLibrary2.CompositeType4>();
				for (int i2 = 0; i2 < src2.composite4List.Count; i2++)
				{
					src3 = src2.composite4List[i2];
					dest3 = new ClassLibrary2.CompositeType4();
					dest3.identifier = src3.identifier;
					dest3.Width = src3.Width;
					src4 = src3.compositeType5;
					dest4 = new ClassLibrary2.CompositeType5();
					dest4.signedByte = src4.signedByte;
					dest4.isEnabled = src4.isEnabled;
					dest3.compositeType5 = dest4;
					dest2.composite4List.Add(dest3);
				}
				src3 = src2.compositeType5;
				dest3 = new ClassLibrary2.CompositeType5();
				dest3.signedByte = src3.signedByte;
				dest3.isEnabled = src3.isEnabled;
				dest2.compositeType5 = dest3;
				src3 = src2.struct1;
				dest3 = new ClassLibrary2.Struct1();
				dest3.category = src3.category;
				dest3.id = src3.id;
				dest2.struct1 = dest3;
				dest2.LastUpdated = src2.LastUpdated;
				dest1.composite3Collection.Add(dest2);
			}
			src2 = src1.compositeType3;
			dest2 = new ClassLibrary2.CompositeType3();
			dest2.unsignedID = src2.unsignedID;
			dest2.composite4List = new System.Collections.Generic.List<ClassLibrary2.CompositeType4>();
			for (int i2 = 0; i2 < src2.composite4List.Count; i2++)
			{
				src3 = src2.composite4List[i2];
				dest3 = new ClassLibrary2.CompositeType4();
				dest3.identifier = src3.identifier;
				dest3.Width = src3.Width;
				src4 = src3.compositeType5;
				dest4 = new ClassLibrary2.CompositeType5();
				dest4.signedByte = src4.signedByte;
				dest4.isEnabled = src4.isEnabled;
				dest3.compositeType5 = dest4;
				dest2.composite4List.Add(dest3);
			}
			src3 = src2.compositeType5;
			dest3 = new ClassLibrary2.CompositeType5();
			dest3.signedByte = src3.signedByte;
			dest3.isEnabled = src3.isEnabled;
			dest2.compositeType5 = dest3;
			src3 = src2.struct1;
			dest3 = new ClassLibrary2.Struct1();
			dest3.category = src3.category;
			dest3.id = src3.id;
			dest2.struct1 = dest3;
			dest2.LastUpdated = src2.LastUpdated;
			dest1.compositeType3 = dest2;
			dest1.URI = src1.URI;
			dest1.Total = src1.Total;
			dest0.compositeType2 = dest1;
			return dest0;
		}
	}

